package org.mobilesynergies.epic.service.java;


import org.mobilesynergies.epic.client.EpicClient;
import org.mobilesynergies.epic.client.EpicCommandInfo;


public class EpicService {

	private static String USERNAME = "peter";
	private static String PASSWORD = "peter";
	private static String SERVER = "blindeshendl.cg.tuwien.ac.at";
	
	//private static String SERVER = "JabberIM.de ";
	//private static String USERNAME = "test1234";
	//private static String PASSWORD = "test1234";
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		EpicClient client = new EpicClient();
		try{
			if(client.establishConnection(SERVER)){
				client.authenticateUser(USERNAME, PASSWORD);
			}
			
			EpicCommandInfo[] commands = client.getEpicCommands("andi@"+SERVER+"/Smack");
			for(int i=0; i<commands.length; i++) {
				System.out.println(commands[i].getHumanReadableName()+" "+commands[i].getEpicNodeId()+" "+commands[i].getEpicCommandId());
			}
			
		} catch (Exception e) {
			
		}
		
		while(true) {
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}


}
